#include "mylineedit.h"

#include <QKeyEvent>
#include <QDebug>

MyLineEdit::MyLineEdit(QWidget *parent) : QLineEdit(parent)
{

}

void MyLineEdit::keyPressEvent(QKeyEvent *event)
{
    if(event->key() == Qt::Key_Escape)
    {
        qDebug() << "esc被按了";
    }
    else if (event->key() == Qt::Key_Return)
    {
        qDebug() << "回车被按了";
    }

    return QLineEdit::keyPressEvent(event);
}
void MyLineEdit::keyReleaseEvent(QKeyEvent *event)
{
    qDebug() << "键盘弹起";
    return QLineEdit::keyReleaseEvent(event);
}
